<template>
	<view class="no-data-view" :style="customStyle">
		<image v-if="imageName" class="no-data-image" mode="widthFix" :style="'width:' + imageWidth + 'rpx'"
			:src="wudingdanImage"></image>
		<text v-if="text" class="text-view" :style="'color:' + textColor">{{ text }}</text>
		<slot></slot>
	</view>
</template>

<script>
	import {
		baseUrl
	} from "@/utils/config.js"
	export default {
		props: {
			customStyle: {
				type: String,
				default: '',
			},
			imageName: {
				// 图片
				type: [String, Boolean],
				default: 'wushouzhiquesheng@3x.png',
			},
			imageWidth: {
				type: [Number, String],
				default: '374',
			},
			text: {
				// 提示文字
				type: [String, Boolean],
				default: '当前暂无数据',
			},
			textColor: {
				type: String,
				default: '#8D8D8D'
			}
		},
		computed: {
			wudingdanImage() {
				return baseUrl + this.imageName
			},
		},
	}
</script>

<style lang="scss" scoped>
	.no-data-view {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		color: #999999;
		font-size: 26rpx;
		padding: 30rpx;
		border-radius: 12rpx;
		min-height: 460rpx;
		margin-top: 50rpx;
		background-color: transparent;

		.no-data-image {
			width: 240rpx;
			height: 240rpx;
			margin: 50rpx auto 48rpx;
		}

		.text-view {}
	}
</style>